package com.guonl.controller;

import com.guonl.service.SpringRetryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * spring-retry原生使用
 */
@Slf4j
@RestController
@RequestMapping("/spring-retry")
public class SpringRetryController {

    @Autowired
    private SpringRetryService retryService;

    @GetMapping("/test")
    public String test(@RequestParam("code") Integer code) throws Exception{
        retryService.retry(code);
        return "ok";
    }


}
